Script error message

Well the thins is when I run the script I got follow error:
-R-E- DXL: <Line:26> Variable not designated (m)
-I- DXL: Execution halt

But the thing is that I did declare the Module m. So why I get this message?
 

/*===========================================================================================
                                                                Variables
==========================================================================================*/
Module m
Item i
string moduleName
Project pSys = project "/EMB550_04_Systems"
 
/*===========================================================================================
                                                                        Interface Items
==========================================================================================*/
DB GUI = create "Checklist Test"
DBE selectChoiceQCSYS, selectChoiceQCHF
DBE textMultiLine
 
/*===========================================================================================
                                                                        Answer Types
==========================================================================================*/
string options[] = {"Not Evaluated", "YES", "NO"}
 
/*===========================================================================================
                                                                        Questions
==========================================================================================*/ 
selectChoiceQCSYS = choice(GUI, "Faça uma pergunta aqui", options, 0)
selectChoiceQCHF = choice(GUI, "Faça outra pergunta aqui", options, 0)
textMultiLine = text(GUI, "Completeness Validation Comments", m."Completeness Validation Comments" "" ,30, 60, false )
 
/*========================================================================================
                                                                        Main Program
==========================================================================================*/
 
void buttonOK (DB GUI){
 
string moduleName
string aux = ""
bool wasModified = false
 
        for i in pSys do {
                if (type(i) "" == "Formal") {
                moduleName = name(i)            
                if(matches("-R$", moduleName)){
                if(canModify(m)){
   if (get(selectChoiceQCSYS) =="NO" || get(selectChoiceQCHF)=="NO" ) {
    if (get(textMultiLine) == "") {
                                warningBox("Add comments that describe why the requirement is not valid or the data entered will not be saved.\nThis will help author to correct the requirement.")
                                return
                        }
                } 
           
                        aux = get(selectChoiceQCSYS)
                        if(m."Validation QCSYS" "" != aux) {
                                m."Validation QCSYS" = aux
                                wasModified = true
                        }                    
                        aux = get(selectChoiceQCHF)
                        if(m."Validation QCHF" "" != aux) {
                                m."Validation QCHF" = aux
                                wasModified = true
                        }    
                        aux = get(textMultiLine)
                        if(m."Completeness Validation Comments" "" != aux) {
                                m."Completeness Validation Comments" = get(textMultiLine)
                                wasModified = true
                        }                    
                        
                        
                }
                else infoBox "Cannot modify current object."
                        
                        
                save m
                close m
                                
            }
                }
        }
}
 
ok (GUI,"Apply!", buttonOK)
show GUI

Bruwbruw - Wed Oct 17 10:03:27 EDT 2012

Re: Script error message
llandale - Wed Oct 17 11:26:42 EDT 2012

-R-E- The "-R" means it is a Runtime error. Had you failed to declare "m" you would get this:
  • -E- DXL: <Line:26> undeclared variable (m)

Don't know about "not designated", but variable "m" has no value and you would get "unassigned variable (m)" message (in English anyway). If you do this at line 4
  • Module m = null
you should get
  • "null Module parameter was passed into argument position 1".

I think you want this at line 4:
  • Module m = current

-Louie

Further down, it seems wrong to me to "save" and "close" a module that you did not actually open; and in any case it seems you are closing the module inside a loop in which you presume it to be open.

Seems to me you should check (canModify(m)) at the top and don't bother displaying the dialog at all.

Re: Script error message
Martin_Hunter - Wed Oct 17 11:29:41 EDT 2012

You have declared variable m, but not designated it ie

Module m = current
Martin